#!/bin/sh
set -e
if [ "$1" != "--upstream-version" ]
then
  echo "Usage: $0 --upstream-version VERSION"
  exit 1
fi
upstream_version="$2"
# Create changelog entry, so build tools can find the upstream version
dch -v "$upstream_version-1" --distribution UNRELEASED --preserve \
 "UNRELEASED"
git add debian/changelog
# Amend the merge commit message
if [ -f announce.tmp ]
then
  git commit --amend -F announce.tmp
  rm announce.tmp
else
  git commit --amend
fi
